﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HCFramework.API.LINQ;

namespace HCFramework.Product.Confirmation.Control
{
    public partial class OrderInfo : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public void BindData(Order order)
        {
            litDate.Text = order.CreatedDate.ToShortDateString();
            litDeliveryMethod.Text = E.Method.GetDisplayName_DeliveryType((E.DeliveryType)order.DeliveryType);
            litPaymentMethod.Text = E.Method.GetDisplayName_PaymentMethod((E.PaymentMethod)order.PaymentMethod);
            litStatus.Text = E.Method.GetDisplayName_OrderStatus((E.OrderStatus)order.Status);
            litTotalPrice.Text = C.OrderController.GetTotalPrice(order.OrderID).ToString("N0");

            litDeliveryMethod.Text = M.Common.GetLang(litDeliveryMethod.Text);
            litPaymentMethod.Text = M.Common.GetLang(litPaymentMethod.Text);
            litStatus.Text = M.Common.GetLang(litStatus.Text);
        }
    }
}